package erfgame.core.util;

import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;

import erfgame.core.path.DefaultCostEstimator;

public class DefaultCostEstimatorTester {

	private DefaultCostEstimator estimator;
	
	@Before
	public void setUp() {
		estimator = new DefaultCostEstimator(1);
	}
	
	@Test
	public void testZeroCost() {
		int cost = estimator.estimate(1, 1, 0, 1, 1, 0);
		assertEquals( cost, 0 );
	}
	
	@Test
	public void testOneCost() {
		int cost = estimator.estimate(1, 1, 0, 1, 2, 0);
		assertEquals( cost, 1 );
	}
	
	@Test
	public void testTwoCost() {
		int cost = estimator.estimate(1, 1, 0, 2, 1, 0);
		assertEquals( cost, 2 );
	}
	
	@Test 
	public void testFourCost() {
		int cost = estimator.estimate(0, 2, 0, 2, 2, 0);
		assertEquals( cost, 4 );
	}

	@Test 
	public void testFiveCost() {
		int cost = estimator.estimate(0, 2, 0, 3, 3, 0);
		assertEquals( cost, 5 );
	}
	
	@Test 
	public void testUnevenFourCost() {
		int cost = estimator.estimate(1, 1, 0, 3, 3, 0);
		assertEquals( cost, 4 );
	}

}
